﻿app.service('dicSet', function ($http) {
    var apiURL = serverURL;
    //var paramCallback = QueryUriParamBuilder.queryParam('callback', 'JSON_CALLBACK').build();
    // 病人详情，未预约
    this.GetPatient=function (param) {
        return $http.get('http://172.16.125.167:8084/api/Patient/Week/ReservationFlag/'+param)

    };

    // // 未预约
    // this.GetStatus = function () {
    //     //return $http.jsonp(apiURL + paramCallback);
    //     return $http.get("http://115.159.221.58:8094/api/Exam/GetBy/GetDetails");
    // };
    // // 预约
    // this.GetExamByStatus = function (statusCode) {
    //     //return $http.jsonp(apiURL + paramCallback);
    //     return $http.get("http://115.159.221.58:8094/api/Exam/Week/ReservationFlag/"+statusCode+"/GetDetails");
    // };
    // 条件查询（条件包括查询条件和预约状态【全部、已预约和未预约】）
    // 查询条件{patientid：，。。。。，ReservationFlag：0,1,2}
    this.GetExamsByParams=function(param){
        return $http.post("http://172.16.125.167:8084/api/Exam/GetBy/GetDetails",param);
        // return $http.get("http://115.159.221.58:8094/api/Exam/Today/Status/",param);
    };
    // 号源
    this.GetResource=function (param) {
        return $http.post('http://172.16.125.167:8084/api/ResNumber/days/by/',param)
    }
    //具体某天号源
    this.GetDayResource=function (param) {
        return $http.post('http://172.16.125.167:8084/api/ResNumber/day/by/',param)
    }
    //号源分组
    this.GetGroupResource=function (param) {
        return $http.post('http://172.16.125.167:8084/api/ResNumber/day/by/',param)
    }
    //预约接口
    //[{'Groupid':'1','Patientid':'1','VisitNo':'1','Name':'a','Gender':'1','DateOfBirth':'2017-04-13T00:00:00',
    //     'ExamReqDatetime':'0001-01-T00:00:00'
    //     ,'Reservationid':'1','GrouName':'1','ReservationDate':'2017-04-14T00:00:00','ReservationTime':'1','ExamNo':'1','WeekName':'1',
    //     'CreateDatetime':'2017-04-14T00:00:00','CreaterCode':'1','Creater':'1','SerialNo':'120'}];
    this.submit=function (param) {
        return $http.post('http://172.16.125.167:8084/api/ResRecord/DoAppointment',param)
    }
    this.cancel=function (param) {
        return $http.post('http://172.16.125.167:8084/api/ResRecord/DoCancel',param)
    }
    this.calculateResource=function (param) {
       return $http.post('http://172.16.125.167:8084/api/ResNumber/Calculate/',param)
    }
});